//  __  __           _       _            
// |  \/  | ___   __| |_   _| | ___  ___  
// | |\/| |/ _ \ / _` | | | | |/ _ \/ __| 
// | |  | | (_) | (_| | |_| | |  __/\__ \ 
// |_|  |_|\___/ \__,_|\__,_|_|\___||___/ 
//                                        
//  
// by Stephan Raabe (2023) 
// ----------------------------------------------------- 
//
{
    // Workspaces
    "hyprland/workspaces" : {
        "on-click": "activate",
        "active-only": false,
        "all-outputs": true,
        "format": "{}",
        "format-icons": {
			"urgent": "",
			"active": "",
			"default": ""
        },
        "persistent-workspaces": {
            // START WORKSPACES
    "*": 5
            // END WORKSPACES
        }       
    },

    // Taskbar
    "wlr/taskbar": {
        "format": "{icon}",
        "icon-size": 18,
        "tooltip-format": "{title}",
        "on-click": "activate",
        "on-click-middle": "close",
        "ignore-list": [
           "Alacritty"
        ],
        "app_ids-mapping": {
            "firefoxdeveloperedition": "firefox-developer-edition"
        },
        "rewrite": {
            "Firefox Web Browser": "Firefox",
            "Foot Server": "Terminal"
        }
    },

    // Hyprland Window
    "hyprland/window": {
        "rewrite": {
            "(.*) - Brave": "$1",
            "(.*) - Chromium": "$1",
            "(.*) - Brave Search": "$1",
            "(.*) - Outlook": "$1",
            "(.*) Microsoft Teams": "$1"
        },
        "separate-outputs": true
    },

    // Empty
    "custom/empty": {
        "format": ""
    },
    
    // Cliphist
    "custom/cliphist": {
        "format": "",
        "on-click": "sleep 0.1 && ~/dotfiles/scripts/cliphist.sh",
        "on-click-right": "sleep 0.1 && ~/dotfiles/scripts/cliphist.sh d",
        "on-click-middle": "sleep 0.1 && ~/dotfiles/scripts/cliphist.sh w",
        "tooltip": false
    },

    // Filemanager Launcher
    "custom/filemanager": {
        "format": "",
        "on-click": "thunar",
        "tooltip": false
    },

    // Calculator
    "custom/calculator": {
        "format": "",
        "on-click": "qalculate-gtk",
        "tooltip": false
    },

    // Wofi Application Launcher
    "custom/appmenu": {
        // START APPS LABEL
        "format": "Apps",
        // END APPS LABEL
        "on-click": "sleep 0.2;wofi -show drun -c ~/.config/hypr/themes/duo/wofi/config -s ~/.config/hypr/themes/duo/wofi/style.css -replace",
        "on-click-right": "~/dotfiles/hypr/scripts/keybindings.sh",
        "tooltip": false
    },

    // Wofi Application Launcher
    "custom/appmenuicon": {
        "format": "",
        "on-click": "wofi -show drun -replace",
        "on-click-right": "~/dotfiles/hypr/scripts/keybindings.sh",
        "tooltip": false
    },    

    // Power Menu
    "custom/exit": {
        "format": "",
        "on-click": "wlogout",
        "tooltip": false
    },

    // Keyboard State
    "keyboard-state": {
        "numlock": true,
        "capslock": true,
        "format": "{name} {icon}",
        "format-icons": {
            "locked": "",
            "unlocked": ""
        }
    },

    // System tray
    "tray": {
        "icon-size": 21,
        "spacing": 10
    },

    // Clock
    "clock": {
        // TIMEDATEFORMAT
        "format": "{:%H:%M %a}",
        // "timezone": "America/New_York",
        "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
        // START CLOCK FORMAT
        "format-alt": "{:%Y-%m-%d}"
        // END CLOCK FORMAT
    },

    // System
    "custom/system": {
        "format": "",
        "tooltip": false
    },

    // CPU
    "cpu": {
        "format": "/ C {usage}% ",
        "on-click": "alacritty -e htop"
    },

    // Memory
    "memory": {
        "format": "/ M {}% ",
        "on-click": "alacritty -e htop"
    },

    // Harddisc space used
    "disk": {
        "interval": 30,
        "format": "D {percentage_used}% ",
        "path": "/",
        "on-click": "alacritty -e htop"
    }, 

    "hyprland/language": {
        "format": "/ K {short}"
    },

    // Group Hardware
    "group/hardware": {
        "orientation": "inherit",
        "drawer": {
            "transition-duration": 300,
            "children-class": "not-memory",
            "transition-left-to-right": false
        },        
        "modules": [
            "custom/system",
            "disk",
            "cpu",
            "memory",
            "hyprland/language"
        ]
    },
    
    // Group Settings
    "group/settings": {
        "orientation": "horizontal",
        "modules": [
            "custom/settings",
        ]
    },

    // Group Quicklinks
    "group/quicklinks": {
        "orientation": "horizontal",
        "modules": [
            "custom/filemanager",
         ]
    },

    // Network
    "network": {
        "format": "{ifname}",
        "format-wifi": "   {signalStrength}%",
        "format-ethernet": "  {ifname}",
        "format-disconnected": "Disconnected",
        "tooltip-format": " {ifname} via {gwaddri}",
        "tooltip-format-wifi": "  {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\nUp: {bandwidthUpBits} Down: {bandwidthDownBits}",
        "tooltip-format-ethernet": " {ifname}\nIP: {ipaddr}\n up: {bandwidthUpBits} down: {bandwidthDownBits}",
        "tooltip-format-disconnected": "Disconnected",
        "max-length": 50,
        "on-click": "nm-connection-editor"
    },

    // Battery
    "battery": {
        "states": {
            // "good": 95,
            "warning": 30,
            "critical": 15
        },
        "format": "{icon}   {capacity}%",
        "format-charging": "  {capacity}%",
        "format-plugged": "  {capacity}%",
        "format-alt": "{icon}  {time}",
        // "format-good": "", // An empty format will hide the module
        // "format-full": "",
        "format-icons": [" ", " ", " ", " ", " "]
    },

    // Pulseaudio
    "pulseaudio": {
        // "scroll-step": 1, // %, can be a float
        "format": "{icon} {volume}%",
        "format-bluetooth": "{volume}% {icon} {format_source}",
        "format-bluetooth-muted": " {icon} {format_source}",
        "format-muted": " {format_source}",
        "format-source": "{volume}% ",
        "format-source-muted": "",
        "format-icons": {
            "headphone": "",
            "hands-free": "",
            "headset": "",
            "phone": "",
            "portable": "",
            "car": "",
            "default": ["", " ", " "]
        },
        "on-click": "pavucontrol"
    },

    // Bluetooth
    "bluetooth": {
        "format": " {status}",
        "format-disabled": "",
        "format-off": "",
        "interval": 30,
        "on-click": "blueman-manager",
        "format-no-controller": ""
    },

    // Other
    "user": {
        "format": "{user}",
        "interval": 60,
        "icon": false,
    },

    // Idle Inhibator
    "idle_inhibitor": {
        "format": "{icon}",
        "tooltip": true,
        "format-icons":{
            "activated": "",
            "deactivated": ""
        },
        "on-click-right": "hyprlock"        
    }
}


